<script>
	var url;
	$(document).ready(function(){
		
		loaddata = function(){
			$.ajax({ 
				type: "POST",   
				url: base_url+'daftar_ulang/getdata',   
				data: $('#form2').serialize(),
				async: true,
				success : function(respon)
				{
					if(respon == ''){
						$('#tbodypendaftar').html('<tr><td align="center" colspan="6">Tidak Terdapat Data Dalam Database</td></tr>');
					}else{
						$('#tbodypendaftar').html(respon);
					}
				}
			});
		}
		
		saveData = function(){
			$('#form2').form('submit',{
				url: base_url+'daftar_ulang/save',
				onSubmit: function(){
					return $(this).form('validate');
				},
				success: function(result){
					//alert(result);
					var result = eval('('+result+')');
					if (result.success){
						$.messager.show({
							title: 'Succes',
							msg: 'Data Berhasil Disimpan'
						});
						$('#tbodypendaftar').html(' ');
					} else {
						$.messager.show({
							title: 'Error',
							msg: result.msg
						});
					}
				}
			});
		}
		//end saveData
		
	});
</script>
<form name="form2" id="form2" method="post">
	<table border="0" cellpadding="1" cellspacing="1" width="100%">
		<tr>
			<td>
			<div class="fsearch">
				<table border="0" cellpadding="1" cellspacing="1">
					<tr>
						<td>Periode / Gelombang</td>
						<td>: 
							<select id="PMBPeriodID" name="PMBPeriodID" style="width:80px;">
								<?=$this->mdl_prosedur->OptionJadwalPMB(array('value'=>$PMBPeriodID));?>
							</select>
						</td>
						<td>&nbsp;&nbsp;&nbsp;</td>
					
						<td>Jumlah Data Yang Diproses</td>
						<td>:</td>
						<td><input type="textfield" name="jumlah" size="8" maxlength="4"></td>
					
						<td></td>
						<td></td>
						<td align="left" colspan="2" valign="top">
							<a href="#" class="easyui-linkbutton" onclick="loaddata();" iconCls="icon-reload" plain="true">Tampilkan</a>
						</td>
					</tr>
				</table>
			</div>
			</td>
		</tr>
	</table>

	<table class="tbl">
		<thead>
			<tr>
				<th width="20px" bgcolor="#F4F4F4">No.</th>
				<th width="" bgcolor="#F4F4F4">Nama Pendaftar</th>
				<th width="" bgcolor="#F4F4F4">Alamat</th>
				<th width="" bgcolor="#F4F4F4">No Telepon</th>
				<th width="" bgcolor="#F4F4F4">Program Studi</th>				
				<th width="" bgcolor="#F4F4F4">Nama Ortu</th>
				<th width="" bgcolor="#F4F4F4">Alamat Ortu</th>
				<th width="" bgcolor="#F4F4F4">Pekerjaan</th>
				<th width="200px" align="center" bgcolor="#F4F4F4">NIM</th>
			</tr>
		</thead>
		<tbody id="tbodypendaftar">
			
		</tbody>
	</table>
	<br>
	<div align="right"><a href="#" class="easyui-linkbutton" onclick="saveData();" iconCls="icon-save" plain="false">Simpan</a>&nbsp;&nbsp;&nbsp;</div>
</form>